home *** CD-ROM | disk | FTP | other *** search
- Path: wpb-105.magg.net!n4mwd
- From: n4mwd@magg.net (Dennis Hawkins)
- Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
- Subject: Re: Access carry flag from C
- Date: Mon, 19 Feb 1996 16:23:09
- Organization: M.A.G. Information Services (MAGG.NET)
- Message-ID: <n4mwd.40.0010633E@magg.net>
- References: <Dn1C9z.DGv.0.net@indra.com>
- NNTP-Posting-Host: wpb-105.magg.net
- X-Newsreader: Trumpet for Windows [Version 1.0 Rev A]
-
- In article <Dn1C9z.DGv.0.net@indra.com> sullivan@indra.com (Steve Sullivan) writes:
-
- >Is it possible to determine if a fixed point overflow has
- >occurred from within C? For example:
- > i = j + k;
- > if (overflowed) ....;
-
- If you are coding for a PC specific platform, you might be able to drop in
- assembler mode and check the CARRY flag for certain mathmatical operations.
- Not very portable, but I bet it would work. For the example you gave, I would
- probably write an inline macro in ASM and set it to load the carry flag into
- a temp integer. Then the compare would work with the temp. The macro
- would have to be called immediately as all flags are extremely volitile.
-
-
- Dennis Hawkins
- n4mwd@amsat.org
-
- Vote YES for sci.agriculture.poultry!
-